package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by zhangjh on 2016/9/30.
 */
@Entity
@Table(name = "customer_fund")
@DynamicInsert
@DynamicUpdate
public class CustomerFund extends IDEntityMall {
    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '总金额'")
    private BigDecimal totalAmount = BigDecimal.ZERO;
    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '冻结金额'")
    private BigDecimal frozen = BigDecimal.ZERO;
    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '可用金额'")
    private BigDecimal availableAmount = BigDecimal.ZERO;
    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '累计收入'")
    private BigDecimal income = BigDecimal.ZERO;
    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '累计支出'")
    private BigDecimal expend = BigDecimal.ZERO;
    @Column(columnDefinition = "bigint comment'客户ID'")
    private Long customerId;

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }


    public BigDecimal getFrozen() {
        return frozen;
    }

    public void setFrozen(BigDecimal frozen) {
        this.frozen = frozen;
    }

    public BigDecimal getIncome() {
        return income;
    }

    public void setIncome(BigDecimal income) {
        this.income = income;
    }

    public BigDecimal getExpend() {
        return expend;
    }

    public void setExpend(BigDecimal expend) {
        this.expend = expend;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getAvailableAmount() {
        return availableAmount;
    }

    public void setAvailableAmount(BigDecimal availableAmount) {
        this.availableAmount = availableAmount;
    }

    @Override
    public String toString() {
        return "CustomerFund{" +
                "totalAmount=" + totalAmount +
                ", frozen=" + frozen +
                ", availableAmount=" + availableAmount +
                ", income=" + income +
                ", expend=" + expend +
                ", customerId=" + customerId +
                '}';
    }
}
